#include <stdio.h>

typedef union {
	int a;
	char b;
}A;

int cpu_is_little()
{
	union {
		int a;
		char b;
	}endian;
	endian.a = 0x1;
	return endian.b;
}

int main(int argc, char const* argv[])
{
	if (cpu_is_little()) {
		printf("little endian\n");
	} else {
		printf("big endian\n");
	}
	return 0;
}
